package com.mindskip.xzs.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author artka
 * @description:
 * @date 2022/9/14 12:11 AM
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@TableName(value = "department")
public class Department extends Model<Department> implements Serializable {

    private static final long serialVersionUID = 5714680288608028778L;

    /**
     * 部门id
     */
    @TableId(type = IdType.INPUT)
    private Long id;
    /**
     * 部门名称
     */
    private String name;
    /**
     * 父部门id。根部门为1
     */
    @TableField("parent_id")
    private Long parentId;
    /**
     * 在父部门中的次序值。order值大的排序靠前。值范围是[0, 2^32)
     */
    @TableField("sort")
    private Long sort;
    /**
     * 部门负责人的UserID
     */
    @TableField("department_leader")
    private String departmentLeader;
    /**
     * 所有父id，逗号分隔
     */
    private String ancestors;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    private Boolean deleted;
}
